package com.pojo;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;

/**
 * @author luoqingchen
 * @reate 2022-11-25-18:18
 */
public class User implements InitializingBean {
    private String name;

    public User() {
        System.out.println("===============我是构造函数=================");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        System.out.println("调用setName方法");
        this.name = name;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                '}';
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("value="+name);
        System.out.println("调用afterPropertiesSet方法");
        System.out.println("InitializingBean吧value修改为  666 ");
        this.name="666";
    }

    public void initMethod() {
        System.out.println("value="+name);
        System.out.println("调用initMethod方法");
    }


}
